package com.xing.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @version 1.0
 * @Author Xing
 * @Date 2024/1/12 20:16
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MessageEntity {
    private String chatId;
    /**
     * 0=收信方id，1=群组id，2=null
     */
    private String to;
    private Object info;
    private String time;
    private String from;
    /**
     * 用于区分是否为服务器发出信息：0=offer/answer,1=candidate
     */
    private String server = "0";
    /**
     * 消息模式：0=单对单，1=群组/房间对话，2=广播，3=心跳检测
     */
    private Integer type = 2;

    public MessageEntity(Object info, Integer type) {
        this.info = info;
        this.type = type;
    }

    public MessageEntity(String from, Object info, Integer type) {
        this.from = from;
        this.info = info;
        this.type = type;
    }

}
